#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int removeElement(int* nums, int numsSize, int val)
{
	int i = 0;
	while (i < numsSize)
	{
		if (nums[i] == val)
		{
			int j = i;
			for (; j < numsSize - 1; j++)
			{
				nums[j] = nums[j + 1];
			}
			i--;
			numsSize--;
		}
		i++;
	}
	return numsSize;
}
int main()
{
	int arr[] = { 0,1,2,2,3,0,4,2 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int val = 1;
	int ret = removeElement(arr, sz, val);
	printf("%d\n", ret);
	for (int i = 0; i < ret; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}